<template>
    <div>
        Logout
    </div>
</template>

<script>
import User from "@/api/User.js";
const user=new User();
export default {
    async created(){
        // console.log(123);
        const response=await user.Logout(this.$store.state.token);
        if(response.data){
            // 操作成功，清空所有的state、Session
            this.$store.commit("LoginFailed");
            this.$router.push('/Index');
        }
    }
}
</script>